package executors.completable.future;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

public class ThenAcceptAsyncTest001 {
  public static void main(String[] args) {
    ScheduledExecutorService executors = Executors.newScheduledThreadPool(1);
    
    CompletableFuture<String> uCompletableFuture = CompletableFuture.supplyAsync(() -> {
      System.out.println("这是任务a");
      return "a";
    }, executors);
    
    uCompletableFuture.thenAcceptAsync((result) -> {
      System.out.println("这是任务b");
      System.out.println("b" + result);
    }, executors);
    
    uCompletableFuture.thenAcceptAsync(result -> {
      System.out.println("这是任务c");
      System.out.println("c" + result);
    }, executors);
  }
}
